package com.fish.design.create.singleton.lazy;

/**
 * @PACKAGE_NAME: com.fish.design.create.singleton.lazy
 * @Author: wangyingbin
 * @Date: 2021/11/8 19:04
 * @Description: 懒汉单例模式 线程安全的
 */

public class LazySingleton {

    private LazySingleton (){}
    private static LazySingleton INSTANCE = null;
    public synchronized static LazySingleton getInstance(){
        if(INSTANCE == null) {
            INSTANCE = new LazySingleton();
        }
        return INSTANCE;
    }
}
